﻿<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
  
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Class RandomRoomsMapCreationStrategy&lt;T&gt;
   | RogueSharp </title>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="title" content="Class RandomRoomsMapCreationStrategy&lt;T&gt;
   - RogueSharp ">
    <meta name="generator" content="docfx 2.47.0.0">
    
    <link rel="shortcut icon" href="../images/favicon.ico">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/dracula.min.css">
    <link rel="stylesheet" href="../styles/site.css">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">
    
    
    
  </head>
  <body data-spy="scroll" data-target="#affix" data-offset="120">
    <div id="wrapper">
      <header>
        
        <div class="bg-light">
        <nav class="navbar navbar-expand-lg navbar-light bg-light container">
          
          <a class="navbar-brand" href="../index.html">
            <img id="logo" class="svg" src="../images/logo.svg" alt="RogueSharp" width="36" height="36">
          </a>
          <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
          </button>
        
          <div class="collapse navbar-collapse" id="navbar">
            <!--<form id="search" role="search" class="form-inline my-2 my-lg-0">
              <input id="search-query" class="form-control mr-sm-2" type="search" placeholder="Search" autocomplete="off" aria-label="Search">
            </form>-->
          </div>
        </nav>
        </div>
        
        <div class="bg-dark">
        <nav aria-label="breadcrumb" id="breadcrumb" class="container hide-when-search">
          <!--<ol class="breadcrumb">
            <li class="breadcrumb-item" aria-current="page"></li>
          </ol>-->
        </nav>
        </div>      </header>
      <div role="main" class="container body-content hide-when-search">
      <div class="row">
        
        
        <div class="sidenav hide-when-search col-md-3 pt-md-3 pb-md-3">
          <a class="btn btn-link toc-toggle d-md-none" data-toggle="collapse" data-target="#sidetoggle" href="javascript:;" aria-expanded="true" aria-controls="sidetoggle">
            Show / Hide Table of Contents
          </a>
          <div class="sidetoggle collapse" id="sidetoggle">
            <div id="sidetoc"></div>
          </div>
        </div>
        <div class="article col-md-9">
      <div class="row">
          <div class="col-lg-9">
            <article class="content wrap pt-2 pb-2" id="_content" data-uid="RogueSharp.MapCreation.RandomRoomsMapCreationStrategy`1">
  
  
  <h1 id="RogueSharp_MapCreation_RandomRoomsMapCreationStrategy_1" data-uid="RogueSharp.MapCreation.RandomRoomsMapCreationStrategy`1" class="text-break">Class RandomRoomsMapCreationStrategy&lt;T&gt;
  </h1>
  <div class="markdown level0 summary"><p>The RandomRoomsMapCreationStrategy creates a Map of the specified type by placing rooms randomly and then connecting them with cooridors</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance mt-1">
    <h5 class="text-muted font-weight-light font-italic mb-0">Inheritance</h5>
    <div class="d-flex flex-wrap">
    <div class="level0 mr-1"><span class="xref">System.Object</span><i class="fal fa-arrow-alt-left fa-fw"></i></div>
    <div class="level1"><span class="xref">RandomRoomsMapCreationStrategy&lt;T&gt;</span></div>
    </div>
  </div>
  <div class="implements mt-1">
    <h5 class="font-weight-light font-italic mb-0">
      <a class="text-muted" data-toggle="collapse" data-target="#implementsCollapse" role="button" aria-expanded="false" aria-controls="implementsCollapse">
      Implements
      </a>
    </h5>
    <div class="collapse" id="implementsCollapse">
    <div><a class="xref" href="RogueSharp.MapCreation.IMapCreationStrategy-1.html">IMapCreationStrategy</a>&lt;T&gt;</div>
    </div>
  </div>
  <div class="inheritedMembers mt-1">
    <h5 class="font-weight-light font-italic mb-0">
      <a class="text-muted" data-toggle="collapse" data-target="#inheritedMembersCollapse" role="button" aria-expanded="false" aria-controls="inheritedMembersCollapse">
      Inherited Members
      </a>
    </h5>
    <div class="collapse" id="inheritedMembersCollapse">
    <div>
      <span class="xref">System.Object.Equals(System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.GetHashCode()</span>
    </div>
    <div>
      <span class="xref">System.Object.GetType()</span>
    </div>
    <div>
      <span class="xref">System.Object.MemberwiseClone()</span>
    </div>
    <div>
      <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.ToString()</span>
    </div>
    </div>
  </div>
  <h6 class="mt-1"><i class="text-muted font-weight-light font-italic mb-0">Namespace:</i> <a class="xref" href="RogueSharp.MapCreation.html">RogueSharp.MapCreation</a></h6>
  <h6 class="mt-1"><i class="text-muted font-weight-light font-italic mb-0">Assembly:</i> RogueSharp.dll</h6>
  <h5 id="RogueSharp_MapCreation_RandomRoomsMapCreationStrategy_1_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class RandomRoomsMapCreationStrategy&lt;T&gt; : IMapCreationStrategy&lt;T&gt; where T : IMap, new()</code></pre>
  </div>
  <h5 class="typeParameters">Type Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="parametername">T</span></td>
        <td><p>The type of IMap that will be created</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="constructors">Constructors
  </h3>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/FaronBracy/RogueSharp/new/master/apiSpec/new?filename=RogueSharp_MapCreation_RandomRoomsMapCreationStrategy_1__ctor_System_Int32_System_Int32_System_Int32_System_Int32_System_Int32_.md&amp;value=---%0Auid%3A%20RogueSharp.MapCreation.RandomRoomsMapCreationStrategy%601.%23ctor(System.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Int32)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/FaronBracy/RogueSharp/blob/master/RogueSharp/MapCreation/RandomRoomsMapCreationStrategy.cs/#L48">View Source</a>
  </span>
  <a id="RogueSharp_MapCreation_RandomRoomsMapCreationStrategy_1__ctor_" data-uid="RogueSharp.MapCreation.RandomRoomsMapCreationStrategy`1.#ctor*"></a>
  <h4 id="RogueSharp_MapCreation_RandomRoomsMapCreationStrategy_1__ctor_System_Int32_System_Int32_System_Int32_System_Int32_System_Int32_" data-uid="RogueSharp.MapCreation.RandomRoomsMapCreationStrategy`1.#ctor(System.Int32,System.Int32,System.Int32,System.Int32,System.Int32)">RandomRoomsMapCreationStrategy(Int32, Int32, Int32, Int32, Int32)</h4>
  <div class="markdown level1 summary"><p>Constructs a new RandomRoomsMapCreationStrategy with the specified parameters</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="text-muted font-weight-light font-italic decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public RandomRoomsMapCreationStrategy(int width, int height, int maxRooms, int roomMaxSize, int roomMinSize)</code></pre>
  </div>
  <h5 class="text-muted font-weight-light font-italic parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">width</span></td>
        <td><p>The width of the Map to be created</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">height</span></td>
        <td><p>The height of the Map to be created</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">maxRooms</span></td>
        <td><p>The maximum number of rooms that will exist in the generated Map</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">roomMaxSize</span></td>
        <td><p>The maximum width and height of each room that will be generated in the Map</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">roomMinSize</span></td>
        <td><p>The minimum width and height of each room that will be generated in the Map</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="RogueSharp_MapCreation_RandomRoomsMapCreationStrategy_1__ctor_System_Int32_System_Int32_System_Int32_System_Int32_System_Int32__remarks" class="text-muted font-weight-light font-italic">Remarks</h5>
  <div class="markdown level1 remarks"><p>Uses DotNetRandom as its RNG</p>
</div>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/FaronBracy/RogueSharp/new/master/apiSpec/new?filename=RogueSharp_MapCreation_RandomRoomsMapCreationStrategy_1__ctor_System_Int32_System_Int32_System_Int32_System_Int32_System_Int32_RogueSharp_Random_IRandom_.md&amp;value=---%0Auid%3A%20RogueSharp.MapCreation.RandomRoomsMapCreationStrategy%601.%23ctor(System.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Int32%2CSystem.Int32%2CRogueSharp.Random.IRandom)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/FaronBracy/RogueSharp/blob/master/RogueSharp/MapCreation/RandomRoomsMapCreationStrategy.cs/#L29">View Source</a>
  </span>
  <a id="RogueSharp_MapCreation_RandomRoomsMapCreationStrategy_1__ctor_" data-uid="RogueSharp.MapCreation.RandomRoomsMapCreationStrategy`1.#ctor*"></a>
  <h4 id="RogueSharp_MapCreation_RandomRoomsMapCreationStrategy_1__ctor_System_Int32_System_Int32_System_Int32_System_Int32_System_Int32_RogueSharp_Random_IRandom_" data-uid="RogueSharp.MapCreation.RandomRoomsMapCreationStrategy`1.#ctor(System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,RogueSharp.Random.IRandom)">RandomRoomsMapCreationStrategy(Int32, Int32, Int32, Int32, Int32, IRandom)</h4>
  <div class="markdown level1 summary"><p>Constructs a new RandomRoomsMapCreationStrategy with the specified parameters</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="text-muted font-weight-light font-italic decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public RandomRoomsMapCreationStrategy(int width, int height, int maxRooms, int roomMaxSize, int roomMinSize, IRandom random)</code></pre>
  </div>
  <h5 class="text-muted font-weight-light font-italic parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">width</span></td>
        <td><p>The width of the Map to be created</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">height</span></td>
        <td><p>The height of the Map to be created</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">maxRooms</span></td>
        <td><p>The maximum number of rooms that will exist in the generated Map</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">roomMaxSize</span></td>
        <td><p>The maximum width and height of each room that will be generated in the Map</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">roomMinSize</span></td>
        <td><p>The minimum width and height of each room that will be generated in the Map</p>
</td>
      </tr>
      <tr>
        <td><a class="xref" href="RogueSharp.Random.IRandom.html">IRandom</a></td>
        <td><span class="parametername">random</span></td>
        <td><p>A class implementing IRandom that will be used to generate pseudo-random numbers necessary to create the Map</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
  </h3>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/FaronBracy/RogueSharp/new/master/apiSpec/new?filename=RogueSharp_MapCreation_RandomRoomsMapCreationStrategy_1_CreateMap.md&amp;value=---%0Auid%3A%20RogueSharp.MapCreation.RandomRoomsMapCreationStrategy%601.CreateMap%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/FaronBracy/RogueSharp/blob/master/RogueSharp/MapCreation/RandomRoomsMapCreationStrategy.cs/#L68">View Source</a>
  </span>
  <a id="RogueSharp_MapCreation_RandomRoomsMapCreationStrategy_1_CreateMap_" data-uid="RogueSharp.MapCreation.RandomRoomsMapCreationStrategy`1.CreateMap*"></a>
  <h4 id="RogueSharp_MapCreation_RandomRoomsMapCreationStrategy_1_CreateMap" data-uid="RogueSharp.MapCreation.RandomRoomsMapCreationStrategy`1.CreateMap">CreateMap()</h4>
  <div class="markdown level1 summary"><p>Creates a new IMap of the specified type.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="text-muted font-weight-light font-italic decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public T CreateMap()</code></pre>
  </div>
  <h5 class="text-muted font-weight-light font-italic returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">T</span></td>
        <td><p>An IMap of the specified type</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="RogueSharp_MapCreation_RandomRoomsMapCreationStrategy_1_CreateMap_remarks" class="text-muted font-weight-light font-italic">Remarks</h5>
  <div class="markdown level1 remarks"><p>The Map will be generated by trying to place rooms up to the maximum number specified in random locations around the Map.
Each room will have a height and width between the minimum and maximum room size.
If a room would be placed in such a way that it overlaps another room, it will not be placed.
Once all rooms have have been placed, or thrown out because they overlap, corridors will be created between rooms in a random manner.</p>
</div>
  <h3 id="implements" class="text-muted font-weight-light font-italic">Implements</h3>
  <div>
      <a class="xref" href="RogueSharp.MapCreation.IMapCreationStrategy-1.html">IMapCreationStrategy&lt;T&gt;</a>
  </div>
</article>
            <div id="disqus_thread"></div>
            <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
          </div>
          
          <div class="d-none d-lg-block col-md-3" role="complementary">
            <div class="sideaffix pt-3 pb-3">
              <div class="contribution">
                <ul class="nav">
                  <li>
                    <a href="https://github.com/FaronBracy/RogueSharp/new/master/apiSpec/new?filename=RogueSharp_MapCreation_RandomRoomsMapCreationStrategy_1.md&amp;value=---%0Auid%3A%20RogueSharp.MapCreation.RandomRoomsMapCreationStrategy%601%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link text-info" title="Improve this Doc">
                    <i class="fal fa-edit fa-fw"></i>
                    <span>Improve this Doc</span>
                    </a>
                  </li>
                  <li>
                    <a href="https://github.com/FaronBracy/RogueSharp/blob/master/RogueSharp/MapCreation/RandomRoomsMapCreationStrategy.cs/#L11" class="contribution-link text-info" title="View Source">
                    <i class="fal fa-code fa-fw"></i>
                    <span>View Source</span>
                    </a>
                  </li>
                </ul>
              </div>
              <!--<div class="github-links">
                  <a class="github-button" href="https://github.com/fszlin/certes" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star fszlin/certes on GitHub">Star</a>
              </div>-->
              <nav class="hidden-print affix mt-2" id="affix">
              <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
              </nav>
            </div>
          </div>
          </div>
        </div>
      </div>
      </div>
      
      <footer class="bg-secondary">
        <!--<div class="grad-bottom"></div>-->
        <div class="footer bg-secondary">
          <div class="container">
          <div class="d-flex">
            <div class="p-2 flex-grow-1 text-white">
            <a class="text-white" href="https://github.com/FaronBracy/RogueSharp">RogueSharp &copy; 2014-2020 Faron Bracy</a>
            
            </div>
            <div class="p-2">
              <a class="text-white" href="#top">Back to top</a>
            </div>
          </div>
          </div>
        </div>
      </footer>
    </div>
    
    <script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.1.0/anchor.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/dos.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/powershell.min.js"></script>
    <script type="text/javascript" src="../styles/docfx.js"></script>
  </body>
</html>
